package com.summer.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * MP的相关配置类，如MP拦截器等
 */
@Configuration
public class MybatisPlusSupport {

    /**
     * 创建MP拦截器Bean
     * @return
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mpi = new MybatisPlusInterceptor();
        //配置分页拦截器
        mpi.addInnerInterceptor(new PaginationInnerInterceptor());
        return mpi;
    }

}
